home *** CD-ROM | disk | FTP | other *** search
- Path: info.spt.net.cn!usenet
- From: Xu Yifeng <jafd@public.sta.net.cn>
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: Performance: C vs. C++
- Date: Mon, 15 Jan 1996 10:25:37 -0800
- Organization: ZheJiang Securities Co.Ltd
- Message-ID: <30FA9C21.14EC@public.sta.net.cn>
- References: <30F6BAAC.12B5@iastate.edu>
- NNTP-Posting-Host: ts1-20.sta.net.cn
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (Win16; I)
-
- Steve Lee wrote:
- >
- > Hi,
- > : I was wondering if anyone could tell me what the difference in performance
- :would be between
- : writing a program in C++ vs. C. Assume that the compilers are both of
- :equal quality. I know
- : that certain features such as virtual functions and exception handling add
- :overhead. Are there
- : any others? If you don't implement these features that add the extra
- :overhead, is C++ directly
- : comparable to C in performance then? The only other reason I could see C++
- :being slower than C
- : is programming style. Object-oriented is slower since there are more
- :layers, hence function call
- : overhead.
- :
- : Anyone with some answers, disagreements? Thanks.
- :
- : --
- : Steve Lee
- : Computer Engineering/Computer Science
- : Iowa State University
- : email -> sjlee@iastate.edu
-
- Hi,
-
- I don't think C++ will slower than C, because if you want to use C
- to implement Object Oriented Mothed in you program,you will need to
- manually construct you virtual functions table and data structure lay
- it is diffcult, and programming speed will slow down! On the side,
- C is slower than C++.
-
- Both in C and C++, if you don't need Object Oriented Mothed, they
- have same speed, but C++ is more powerfull.
-
- All in all, C++ is better that C.
-
- Regards,
- Xu yifeng
-